﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/MasterPage.master" AutoEventWireup="true"
    CodeBehind="HSYXRK_BASE.aspx.cs" Inherits="DomMgmtSystem.View.HSYXRK_BASE" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="server">
    <div id="InRegister">
        <div id="yitao">
            <table class="table table-bordered table-hover">
                <thead>
                    <tr>
                        <td colspan="2" class="tableTitle">
                            <asp:Label ID="lbTitle" runat="server" Text=""></asp:Label>
                        </td>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="tableleft">
                            摄区编码 ：
                        </td>
                        <td>
                            <asp:Label ID="lbCSQDH" runat="server" Text=""></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="tableleft">
                            摄区名称 ：
                        </td>
                        <td>
                            <asp:Label ID="lbCSQMC" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="tableleft">
                            摄区面积(平方千米) ：
                        </td>
                        <td>
                            <asp:TextBox ID="txtSQMJ" runat="server" Width="200px" fieldtype="decimal"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="tableleft">
                            硬盘套数 :
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlNYPTS" runat="server">
                                <asp:ListItem Value="1">只一套</asp:ListItem>
                                <asp:ListItem Value="2">共两套</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="tableleft">
                            每套的硬盘数量 ：
                        </td>
                        <td>
                            <asp:TextBox ID="txtNYPS" runat="server" Width="200px" fieldtype="int"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="tableleft">
                            接收日期 ：
                        </td>
                        <td>
                            <div id="datetimepicker1" name="datetimepicker" class="input-append date">
                                <asp:TextBox ID="txtDTJSRQ" runat="server" Width="172px" fieldtype="nvarchar" MaxLength="50"
                                    isnull='False'></asp:TextBox>
                                <span class="add-on"><i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
                                </span>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="tableleft">
                            入库日期 ：
                        </td>
                        <td>
                            <div id="Div1" name="datetimepicker" class="input-append date">
                                <asp:TextBox ID="txtDTRKRQ" runat="server" Width="172px" fieldtype="nvarchar" isnull='False'></asp:TextBox><span
                                    class="add-on"><i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
                                </span>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="tableleft">
                            航摄单位 ：
                        </td>
                        <td>
                            <asp:TextBox ID="txtCHSDW" runat="server" Width="200px" fieldtype="nvarchar"></asp:TextBox>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <table class="table table-bordered">
            <tr>
                <td colspan="2" class="tableTitle">
                    <strong style="float: left">&nbsp; 硬盘数据</strong> <a id="addertao" onclick="javascript:addrow();SetdatePicker();"
                        title="添加" style='cursor: pointer;'>
                        <img id="imgAdd" src="../images/add.gif" style="float: right; right: 5px; border: 0px;" />
                    </a>
                </td>
            </tr>
        </table>
        <div id="ertao" style="overflow: scroll;">
            <table class="table table-bordered table-hover" id="hdList">
                <thead>
                    <tr>
                        <td style="display: none">
                        </td>
                        <td>
                            硬盘套数
                        </td>
                        <td>
                            硬盘SN
                        </td>
                        <td>
                            硬盘号
                        </td>
                        <td>
                            分区号
                        </td>
                        <td>
                            数据位
                        </td>
                        <td>
                            数据类型
                        </td>
                        <td>
                            航摄日期
                        </td>
                        <td>
                            地面分辨率（米）
                        </td>
                        <td>
                            航摄仪型号
                        </td>
                        <td>
                            焦距
                        </td>
                        <td>
                            数据量(TB)
                        </td>
                        <td>
                            像片数/扫描片数
                        </td>
                        <td>
                            航摄比例尺
                        </td>
                        <td>
                            扫描分辨率
                        </td>
                        <td>
                            扫描单位
                        </td>
                        <td>
                            具体内容
                        </td>
                        <td>
                            存放柜号
                        </td>
                        <td>
                            存放层号
                        </td>
                        <td>
                            存放列号
                        </td>
                        <td>
                            备注
                        </td>
                        <td>
                        </td>
                    </tr>
                </thead>
                <tbody>
                    <%= rows %>
                </tbody>
            </table>
        </div>
        <div class="divcenter">
            <asp:Button ID="btnInHSRegisterSave" runat="server" Text="保 存" UseSubmitBehavior="false"
                class="btn btn-primary" OnClientClick="javascript:if(CheckPage()==false) return false;createhdList();clearRow();"
                OnClick="btnInHSRegisterSave_Click"></asp:Button>&nbsp;&nbsp;
            <asp:Button ID="btnBack" runat="server" Text="返 回" ishow="true" OnClientClick="javascript:clearRow();"
                OnClick="btnBack_Click" class="btn btn-success" Visible="False" />
        </div>
    </div>
    <div style="display: none">
        <asp:TextBox ID="txthdlist" runat="server"></asp:TextBox>
        <asp:TextBox ID="txtCSQMC" runat="server"></asp:TextBox>
        <asp:TextBox ID="txtRow" runat="server"></asp:TextBox>
    </div>
    <script language="javascript" type="text/javascript">
        function addrow() {
            var rows = $("#hdList").find("tr");
            var row = rows[1];
            $("#hdList>tbody").append($("#Content_txtRow").val());
        }
        function clearRow() {
            $("#Content_txtRow").val("");
        }
        function delrow(a) {
            $(a).parent().parent().remove();
        }
        function createhdList() {
            var rows = $("#hdList").find("tr");
            var list = "[";
            $("#hdList").find("tr").each(function () {
                var inputs = $(this).find("input");
                var selects = $(this).find("select");
                if (inputs.length > 0 || selects.length > 0) {
                    list = list + "{";
                    for (var i = 0; i < inputs.length; i++) {
                        if (inputs[i].value != "") {
                            if (inputs[i].getAttribute("fieldtype") == "nvarchar")
                                list = list + "" + inputs[i].name + ":\"" + inputs[i].value + "\",";
                            if (inputs[i].getAttribute("fieldtype") == "decimal" || inputs[i].getAttribute("fieldtype") == "int")
                                list = list + "" + inputs[i].name + ":" + inputs[i].value + ",";
                        }
                    }
                    for (var i = 0; i < selects.length; i++) {
                        if (selects[i].value != "") {
                            if (selects[i].getAttribute("fieldtype") == "nvarchar")
                                list = list + "" + selects[i].name + ":\"" + selects[i].value + "\",";
                            if (selects[i].getAttribute("fieldtype") == "decimal" || inputs[i].getAttribute("fieldtype") == "int")
                                list = list + "" + selects[i].name + ":" + selects[i].value + ",";
                        }
                    }

                    list = list.substring(0, list.length - 1) + "},";
                }
            });
            list = list.substring(0, list.length - 1) + "]";
            if (list == "]")
                list = "";
            $("#Content_txthdlist").attr("value", list);
        }

        function clearNoNum(obj) {
            obj.value = obj.value.replace(/[^\d.]/g, "");  //清除“数字”和“.”以外的字符
            obj.value = obj.value.replace(/^\./g, "");  //验证第一个字符是数字而不是.
            obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的.
            obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
        }

        $("#Content_dlCSQDH").bind("change", function (event) {
            $("#Content_lbCSQMC").html($("#Content_dlCSQDH").val().split("ξ")[1]);
        });
        function imghide() {
            var imgs = $("img");
            var imgName = "";
            for (var i = 0; i < imgs.length; i++) {
                var paths = imgs[i].src.split("/");
                imgName = paths[paths.length - 1].toLowerCase();
                if (imgName == "add.gif" || imgName == "del.gif")
                    imgs[i].style.display = "none";
            }
        }
    </script>
</asp:Content>
